feat: add Manual Dispatch Panel for triggering equipment operations v…#59
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new admin page component enables manual equipment dispatch, allowing selection of equipment and operations with MQTT topic preview. The feature validates selections, calls the control API, handles success and error states with appropriate toast notifications, and refreshes the equipment cache after dispatch. Changes
Sequence DiagramsequenceDiagram
actor Admin
participant UI as Equipment Dispatch UI
participant API as hardwareApi
participant Backend as Server
participant Cache as Equipment Cache
Admin->>UI: Select equipment & operation
Admin->>UI: Preview MQTT topic
Admin->>UI: Click dispatch
UI->>UI: Validate selection
alt Validation fails
UI->>Admin: Show error toast
else Validation passes
UI->>UI: Set isDispatching=true
UI->>API: controlEquipment(equipmentId, {operation})
API->>Backend: POST dispatch command
alt Success
Backend-->>API: Command accepted
API-->>UI: Success response
UI->>Cache: mutate("equipment")
Cache-->>UI: Equipment list refreshed
UI->>Admin: Show success toast
else Error (ApiError)
Backend-->>API: ApiError response
API-->>UI: Error details
UI->>Admin: Show API error toast
else Error (Unexpected)
API-->>UI: Unexpected error
UI->>Admin: Show generic error toast
end
UI->>UI: Clear selections
UI->>UI: Set isDispatching=false
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
…ia MQTT
Summary by CodeRabbit
Release Notes